<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
	<head>
	<base href="<%=basePath%>">
   
    <script type="text/javascript" >
    	function reImg(){
    		var img = document.getElementById("Img");
    		var i = Math.random();
    		img.src="imgs.jsp?id="+i;
    	}
    	function validate_form(){
    		var name = document.getElementById("username").value;
    		var password = document.getElementById("password").value;
    		var checkco = document.getElementById("checkcode").value;
    		if(name == null || name == ""){
    			alert("用户名不能为空");
    			return false;
    		}
    		if(password == null || password == ""){
    			alert("密码不能为空");
    			return false;
    		}
    		return true;
    	}
    </script>
		<meta charset="utf-8" />
		<title>欢迎来到NBA登录界面</title>
		<link rel="stylesheet" href="css/login.css" />
	</head>
	<body>
		<!--整个界面--->
		<div class="page">
		<!----登录界面--->
		<form action="NbaServlet?act=1" onsubmit="validate_form()" method="post">
			<div class="login">
		    <!---登录窗格---->
				<div class="start">
					<div class="word">
					 <a>欢迎登录NBA系统</a>
					</div>
					<div class="button">
						<a>用户名：</a><input type="text" id="username"  name="username"value="${username}" autofocus="autofocus"placeholder="请输入用户名" /><br />
						<a>密&nbsp;&nbsp;&nbsp;码：&nbsp;</a><input type="password" id="password"  name="password"value="${password}" autofocus="autofocus" placeholder="请输入密码"/><br />
						<div class="yzmhz">
						<a>验证码:&nbsp;</a> &nbsp;
  						<input class="yzm" type="text" id="checkcode" name="checkcode"size="4">
  						<div class="imghh">
  							<img src="imgs.jsp" id="Img" onclick="reImg();"/><br/>
  						</div>
						</div>
  						<!-- 验证码 -->
  						
					</div>
					<div class="bt">
						<input type="submit" value="登录" style="background-image: url(img/1.jpg);" />
						<input  type="button" onclick="location.href='zhuce.jsp'" value="注册" style="background-image: url(img/1.jpg);" / >
					</div>
					<div class="zc">
					<a href="admilogin.jsp">管理员入口</a>
					</div>
				</div>
			</div>
		</form>	
		</div>
	</body>
</html>
